home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 11 - 1995 / 11.04 Apr 95 / TreeAppƒ / Eric's C++ Libraries / Interface Classes / TreeNodeConds.cp < prev   
Encoding:
Text File  |  1996-04-04  |  1.1 KB  |  31 lines  |  [TEXT/KAHL]

  1. // this routine is the same for both the packed and visual tree nodes
  2.  
  3.         // if the node has changed position or size, erase it and
  4.         // note that it must be redrawn
  5.             if (!EqualRect (&OldNodeRect, &newNodeRect))
  6.               {
  7.                   if (!EqualRect (&emptyRect, &OldNodeRect))
  8.                     EraseNode (FALSE);
  9.                 this->needsDraw = eraseKidJoins = TRUE;
  10.               }
  11.             else    // if the node's children have moved, redraw it too
  12.             if (Just != kJustCenter)
  13.               {
  14.                   if ((Orient == kBottomUp) || (Orient == kTopDown))
  15.                     {
  16.                         if (OldGChildRect.right - OldGChildRect.left != 
  17.                             newGChildRect.right - newGChildRect.left)
  18.                           this->needsDraw = eraseKidJoins = TRUE;
  19.                     }
  20.                   else
  21.                     {
  22.                         if (OldGChildRect.bottom - OldGChildRect.top != 
  23.                             newGChildRect.bottom - newGChildRect.top)
  24.                           this->needsDraw =  eraseKidJoins = TRUE;
  25.                     }
  26.               }
  27.               
  28.             if (eraseKidJoins)
  29.               for (i = 1; i <= this->numItems; i++)
  30.                 EraseJoin (this, (CPPVisualTreeNode *)NthChild(i));
  31.